module.exports = {
  devServer: {
    port: 8081, // 避免与后端端口冲突
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      }
    },
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
      'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
    }
  },
  // 设置输出目录
  outputDir: 'dist',
  // 禁用eslint保存时检查
  lintOnSave: false,
  // 设置生产环境不生成source map
  productionSourceMap: false,
  // 添加需要babel转译的依赖库
  transpileDependencies: [
    'vue-echarts'
  ]
} 